package com.scm.erp.framework.repository;

import com.scm.erp.framework.pojo.tUser;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.*;


@Service
@Transactional
public interface tUserRepository extends JpaRepository<tUser,Long> {

    @Query(value = "select user,role,permissions from tUser user,tRole role,tPermissions permissions where user.uAccount=?1 or user.u_Email=?1 or user.uName=?1 or user.uCard=?1",nativeQuery = false)
    Set<tUser> queryAllByAccount(String Account);
}
